﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace AutoUpdaterDotNET
{
    public class ProcessUtils
    {
        public static void ProcessKill(string processName)
        {
            string _processName = processName;
            Process[] localByNameApp = Process.GetProcessesByName(_processName);//获取程序
            if (localByNameApp.Length > 0)
            {
                foreach (var app in localByNameApp)
                {
                    if (!app.HasExited)
                    {
                        app.Kill();
                    }
                }
            }
        }
    }
}
